package ${jpad.packageName}.dao;

import org.springframework.stereotype.Repository;

import com.wing.common.CommonSpringJDBC;
import com.wing.common.util.PageBean;
import ${jpad.packageName}.domain.${jpad.domainName};

@Repository
public class ${jpad.domainName}Dao extends CommonSpringJDBC<${jpad.domainName}, String> {

	public PageBean findPageList(int currentPage, int pageSize, Object... args) {
		String where= " 1=1 ";
		String sql1=" SELECT * FROM ${jpad.tabName} where "+where+" ORDER BY ${jpad.tab_keyName} ASC " +
			" LIMIT "+(currentPage-1) * pageSize+","+pageSize;
		String sql2 = "select count(${jpad.tab_keyName}) from  ${jpad.tabName}  where"+where;
		String[] sqlArray = {sql1,sql2 };
		return super.findPageList(sqlArray, currentPage, pageSize);
	}
	
}